﻿namespace MultipleMonitorVideo.Views
{
    using System;
    using System.Windows;
    using ViewModels;

    /// <summary>
    /// Interaction logic for OverlayInfoView.xaml
    /// </summary>
    public partial class OverlayInfoView
    {
        public OverlayInfoView()
        {
            this.InitializeComponent();
            OverlayInfoViewModel viewModel = this.DataContext as OverlayInfoViewModel;

            if (viewModel != null)
            {
                viewModel.PlayVideoCommand = new ActionCommand(
                    () => this.Video.Play(), () => true);
            }
        }

        private void Video_OnMediaOpened(object sender, RoutedEventArgs e)
        {
        }

        private void Video_OnMediaEnded(object sender, RoutedEventArgs e)
        {
            this.Video.Position = TimeSpan.Zero;
            this.Video.Play();
        }
    }
}
